package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;


/**
 * 飞行线路
 * Create by lzq
 * 2017-06-06
 */
@ApiModel(description = "飞行线路 Create by lzq 2017-06-06")
@Entity
@Table(name = "fly_to_line")
// @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class FlyToLine implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 内容
     */
    @NotNull
    @ApiModelProperty(value = "内容", required = true)
    @Column(name = "content", nullable = false)
    private String content;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Column(name = "order_index")
    private Integer orderIndex;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_date")
    private ZonedDateTime createDate;

    public Integer getFlyto_id() {
        return flyto_id;
    }

    public void setFlyto_id(Integer flyto_id) {
        this.flyto_id = flyto_id;
    }

    /**
     * 父鍵
     */
    @ApiModelProperty(value = "flyto_id")
    @Column(name = "flyto_id")
    private Integer flyto_id;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public FlyToLine content(String content) {
        this.content = content;
        return this;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getOrderIndex() {
        return orderIndex;
    }

    public FlyToLine orderIndex(Integer orderIndex) {
        this.orderIndex = orderIndex;
        return this;
    }

    public void setOrderIndex(Integer orderIndex) {
        this.orderIndex = orderIndex;
    }

    public ZonedDateTime getCreateDate() {
        return createDate;
    }

    public FlyToLine createDate(ZonedDateTime createDate) {
        this.createDate = createDate;
        return this;
    }

    public void setCreateDate(ZonedDateTime createDate) {
        this.createDate = createDate;
    }


    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FlyToLine flyToLine = (FlyToLine) o;
        if (flyToLine.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), flyToLine.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "FlyToLine{" +
            "id=" + getId() +
            ", content='" + getContent() + "'" +
            ", orderIndex=" + getOrderIndex() +
            ", createDate='" + getCreateDate() + "'" +
            "}";
    }
}
